package org.langqiao.appproject.俄罗斯方块;

import java.awt.BorderLayout;   
import java.awt.Color;   
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;   
import javax.swing.JLabel;
import javax.swing.JPanel;   
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.TitledBorder;

public class Clock extends JPanel {     
	private UIManager.LookAndFeelInfo looks[];
	private DrawClock clock ;
    private JPanel pane_clock ;
	JPanel pane_cal;
	public Clock() { 
	   super();
	   
	   looks = UIManager.getInstalledLookAndFeels();
	   changeTheLookAndFeel(2);
	  
	  
	     clock = new DrawClock();
         clock.start();

 	   
 	      this.setBackground(Color.GRAY);   
 	      this.setLayout(new BorderLayout());        
 	      this.setOpaque(false);   
 	    
	     //pane_clock = new JPanel();
	     //pane_clock.setBackground(Color.WHITE);   
	     //pane_clock.setLayout(new BorderLayout());        
	     //pane_clock.setOpaque(false);   
	     this.add(clock);
	     this.setBorder(new TitledBorder("时间日期"));
	    
	     setSize( 300, 300 );   
	     setVisible( true );   
   }
     
   
 	  // TODO Auto-generated method stub 
	   private void changeTheLookAndFeel(int i) {
		   try{
			   UIManager.setLookAndFeel(looks[i].getClassName());
			   SwingUtilities.updateComponentTreeUI(this);
		   }
		   catch(Exception exception){
			   exception.printStackTrace();
		   }
		   
	
		
	}
}    
